Skip to content

[WRONG BRANCH] fix(config): omit webhook credentials from config export - #461

Closed
luvs01 wants to merge 1 commit into
mainfrom
codex/fix-config-export-to-omit-webhook-url-290fr8
Closed

[WRONG BRANCH] fix(config): omit webhook credentials from config export#461
luvs01 wants to merge 1 commit into
mainfrom
codex/fix-config-export-to-omit-webhook-url-290fr8

Conversation

@luvs01

@luvs01 luvs01 commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Prevent disclosure of bearer-equivalent webhookUrl values when an operator runs ocx config export, because the export path previously serialized readConfigDiagnostics().config without applying the existing redaction boundary.

Description

  • Add a recursive omission helper omitWebhookCredentials and apply it to the export sink so ocx config export never emits keys named webhookUrl (file: src/cli/config-command.ts).
  • Preserve existing config show redaction behavior while ensuring both stdout and file export destinations are filtered before serialization (the export branch now calls omitWebhookCredentials(readConfigDiagnostics().config)).
  • Extend and refactor tests in tests/usage/quota-reset-notify.test.ts to cover both stdout (export -) and file export cases and reuse a small configureWebhook fixture helper.
  • Changes are limited to src/cli/config-command.ts and tests/usage/quota-reset-notify.test.ts to minimize surface area.

Testing

  • Ran the focused regression tests with bun test tests/usage/quota-reset-notify.test.ts, which passed (29 passing tests, 0 failures).
  • Ran type checking with bun run typecheck and the repository privacy scan with bun run privacy:scan, both of which succeeded.
  • The full test suite (bun run test) was executed by CI locally but encountered unrelated environment-sensitive failures in other integration tests; the focused regression, typecheck, and privacy scan that validate this change passed.

Codex Task

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T06:29:58.452316Z 98818c1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: b2b4a973-6b06-4c59-88e7-62150e834d8a


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98818c105e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/config-command.ts
if (!path) throw new CliUsageError("export path is required", USAGE);
rejectArgs(args, USAGE);
const content = `${JSON.stringify(readConfigDiagnostics().config, null, 2)}\n`;
const content = `${JSON.stringify(omitWebhookCredentials(readConfigDiagnostics().config), null, 2)}\n`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refuse exports over the active config

When <path> is the active config.json, this sanitized snapshot is written back over the live configuration, permanently deleting quotaResetNotify.webhookUrl and silently disabling webhook notifications after the next reload. Previously, exporting to that path preserved the full config; compare the resolved destination with getConfigPath() and reject an in-place sanitized export before writing.

AGENTS.md reference: src/AGENTS.md:L10-L10

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added the bug Something isn't working label Sep 7, 2026
@github-actions github-actions Bot changed the title fix(config): omit webhook credentials from config export [WRONG BRANCH] fix(config): omit webhook credentials from config export Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as draft September 7, 2026 06:34
@luvs01 luvs01 closed this Sep 7, 2026

luvs01 commented Sep 7, 2026

Copy link
Copy Markdown
Owner Author

Closed as a duplicate of #460. Comparing the two heads with git diff --name-only reports zero differing files, so both PRs carry the same change and only one can be upstreamed. #460 is the surviving copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant